<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <title>接口测试</title>
    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8" src="hgmsdk.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGApp.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGWebUtil.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGUtil.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGPreview.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGRequest.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGUser.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGPush.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGCamera.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGSign.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGFile.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGScanner.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGBackUtil.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGRegisterBack.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGStatus.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGAccelerometer.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGCompass.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGConnection.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGDevice.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGGeolocation.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGNotification.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/HGUserCert.js"></script>

<!--    <link rel="stylesheet" href="res/css/index.css">-->
    <script type="text/javascript" charset="utf-8" src="js/HGStorage.js"></script>
    <link rel="stylesheet" href="css/index.css">

</head>
<body>

<h2 align="center">
    平台接口测试
</h2>

<div class="divc1" id="title1"> HGApp接口示例 </div>

<div class="divc2" id="content1">
    <button id="btn1" class="button" onclick="onPluginShow()">Show</button>插件在html文档加载完成时调用的，用于关闭打开插件时显示的loading页面
    <br>
    <button id="btn2" class="button" onclick="onPluginClose()">Close</button>关闭当前插件
    <br>
    <button id="btn3" class="button" onclick="onPluginBack()">Back</button>从插件返回到主页面
    <br>
    <button id="btn4" class="button" onclick="onPluginClearCache()">ClearCache</button>清空加载插件的所有数据缓存
    <br>
    <button id="btn5" class="button" onclick="onPluginForword_xhw()">forword_xhw</button>跳转学海网APP
    <br>
</div>


<div class="divc1" id="title2">HGWebUtit接口示例</div>
<div class="divc2" id="content2">
    <button id="btn6" class="button" onclick="onCallInnerPlayer()">CallInnerPlayer</button>调用内置播放器播放视频
</div>


<div class="divc1" id="title3">HGUtil接口示例</div>
<div class="divc2" id="content3">

    <button id="btn7" class="button" onclick="toastText()">tosat</button>在屏幕显示提示信息（iOS不支持传入6个参数）
    <br>
    <button id="btn8" class="button" onclick="pickerOne()">pickerOne</button>列表选择器，从列表里选择一项
    <br>
    <button id="btn60" class="button" onclick="pickerMore()">pickerMore</button>列表选择器，从列表里选择多项
    <br>
    <button id="btn9" class="button" onclick="copyText()">copyText</button>需要copy到系统剪贴板的文本
    <br>
    <button id="btn10" class="button" onclick="pasteText()">pasteText</button>从系统剪贴板获取文本的回调函数，带一个文本参数，有可能是空值
    <br>
</div>


<div class="divc1" id="title4">HGPreview接口示例</div>
<div class="divc2" id="content4">

    <button id="btn11" class="button" onclick="hgpreview()">hgpreview</button>打开office文件
</div>

<div class="divc1" id="title5">HGRequest接口示例</div>
<div class="divc2" id="content5">
    <button id="btn12" class="button" onclick="getRequest()">getRequest</button>get请求本地tomcat页面

    <div id="inputSomething">
        请输入域账号，如：cgac\xing_weixin:
    </div>
    <input id="inputLogonName">
    <br>
    <button id="btn13" class="button" onclick="skyDriveServerRequest()">postRequest</button>post请求HGAuth


    <div id="aUpload">
        <a  href="HTML/upload.html" target="_self" title="跳转">跳转断点续传页面（iOS不支持）</a>
    </div>
</div>

<div class="divc1" id="title6">HGUser接口示例</div>
<div class="divc2" id="content6">
    <button id="btn14" class="button" onclick="getUserInfo()">getUserInfo</button>获得用户信息
    <br>
</div>

<div class="divc1" id="title7">HGPush接口示例</div>
<div class="divc2" id="content7">
    <button id="btn15" class="button" onclick="getPush()">getPush</button>获取通过消息推送过来的参数
    <br>
</div>


<div class="divc1" id="title8">HGCamera接口示例</div>
<div class="divc2" id="content8">

    <div class="inputDiv">
        请输入要设置相机的拍照质量参数，默认值为2:

        <select id="selectQuality">
            <option value="0">拍照质量为0</option>
            <option value="1">拍照质量为1</option>
            <option value="2" selected>拍照质量为2</option>
            <option value="3">拍照质量为3</option>
            <option value="4">拍照质量为4</option>
            <option value="5">拍照质量为5</option>
            <option value="6">拍照质量为6</option>
            <option value="7">拍照质量为7</option>
        </select>

    </div>


    <button id="btn16" class="button" onclick="hgCamera()">takePicture(旧拍照接口)</button>拍照
    <br>
    <button id="btn50" class="button" onclick="takePictureNew()">takePictureNew(新拍照接口)</button>拍照
    <br>
    <button id="btn51" class="button" onclick="takePictureForCrop()">takePictureForCrop</button>调用相机拍照，带矩形预览框，自动截取矩形框中部分
    <br>
    <button id="btn52" class="button" onclick="takePictureForCrop2()">takePictureForCrop2</button>调用相机拍照，拍照后可截取图片中的一部分
    <br>
    <button id="btn53" class="button" onclick="takePictureBySysCameraWithPreview()">takePictureBySysCameraWithPreview</button>调用原生相机拍照,有预览（iOS不支持）
    <br>
    <button id="btn54" class="button" onclick="takePictureBySysCameraNoPreview()">takePictureBySysCameraNoPreview</button>调用原生相机拍照,无预览（iOS不支持）
    <br>
</div>

<div class="divc1" id="title9">HGSign接口示例</div>
<div class="divc2" id="content9">
    <button id="btn17" class="button" onclick="getsign()">getsign</button>供用户实现手写签名
    <br>
</div>


<div class="divc1" id="title10">HGFile接口示例</div>
<div class="divc2" id="content10">
    <button id="btn18" class="button" onclick="createDir()">createDir</button>创建文件夹TempDirs/newDir
    <br>
    <button id="btn19" class="button" onclick="removeFile()">removeFile</button>删除文件夹TempDirs/newDir
    <br>
    <button id="btn20" class="button" onclick="renameFile()">renameFile</button>重命名TempDirs/newDir为renameDir
    <br>
    <button id="btn21" class="button" onclick="getFileList()">getFileList</button>获取文件列表
    <br>
    <button id="btn22" class="button" onclick="getBase64File()">getBase64File</button>获取Base64文件
    <br>
</div>


<div class="divc1" id="title11">HGScanner接口示例</div>
<div class="divc2" id="content11">
    <button id="btn25" class="button" onclick="scanner()">scanner</button>二维码扫描
    <br>
    <button id="btn26" class="button" onclick="createQR()">createQR</button>生成二维码信息
    <br>
</div>


<div class="divc1" id="title12">HGBackUtil接口示例</div>
<div class="divc2" id="content12">
    <button id="btn27" class="button" onclick="hgFinish()">hgFinish</button>供插件调用结束关闭插件
    <br>
</div>

<div class="divc1" id="title13">HGRegisterBack接口示例</div>
<div class="divc2" id="content13">
    <button id="btn28" class="button" onclick="RegisterBack()">RegisterBack</button>通知门户有没有Back方法
    <br>
</div>


<div class="divc1" id="title14">HGStatus接口示例</div>
<div class="divc2" id="content14">
    <button id="btn29" class="button" onclick="getHGStatus()">getHGStatus</button>获取门户状态0 :    离线
    1 :    离线锁屏 （锁屏是指门户的应用锁被激活，不是设备的锁屏）
    2 :    锁屏 （同上）
    3 :    正常
    (接口已不再适用海关新的安全要求)
    <br>
</div>


<div class="divc1" id="title15">HGAccelerometer接口示例</div>
<div class="divc2" id="content15">
    <button id="btn30" class="button" onclick="getCurrentAcceleration()">getCurrentAcceleration</button>获得当前沿x、y和z方向的加速度
    <br>
    <button id="btn31" class="button" onclick="startWatch()">startWatch</button>开始监视加速度(每3s获取一次)
    <br>
    <button id="btn32" class="button" onclick="stopWatch()">stopWatch</button>停止监视加速度(停止上边的监视)
    <br>
</div>

<div class="divc1" id="title16">HGCompass接口示例</div>
<div class="divc2" id="content16">
    <button id="btn33" class="button" onclick="getCurrentHeading()">getCurrentHeading</button>获取罗盘的当前朝向
    <br>
    <button id="btn34" class="button" onclick="startWatchCompass()">startWatchCompass</button>开始监视罗盘(每隔5s监视一次)
    <br>
    <button id="btn35" class="button" onclick="stopWatchCompass()">stopWatchCompass</button>停止上边的监视罗盘
    <br>
</div>


<div class="divc1" id="title17">HGConnection接口示例</div>
<div class="divc2" id="content17">
    <button id="btn36" class="button" onclick="checkConnection()">checkConnection</button>检查正在使用的活动网络连接
    <br>
    <button id="btn65" class="button" onclick="cheakVPNState()">CheakvpnStatus</button> 检测vpn的状态（适用于综合办公一类）
</div>

<div class="divc1" id="title18">HGDevice接口示例</div>
<div class="divc2" id="content18">
    <button id="btn37" class="button" onclick="getDeviceInfo()">getDeviceInfo</button>获得设备信息
    <br>
</div>

<div class="divc1" id="title19">HGGeolocation接口示例</div>
<div class="divc2" id="content19">
    <button id="btn38" class="button" onclick="getGeolocation()">getGeolocation</button>返回一个Position对象表示设备的当前位置
    <br>
    <button id="btn39" class="button" onclick="watchPosition()">watchPosition</button>监视设备的当前位置的变化(每隔5s获取一次位置信息)
    <br>
    <button id="btn40" class="button" onclick="clearWatch()">clearWatch</button>停止watchID参数指向的设备位置变化监视
    <br>
</div>


<div class="divc1" id="title20">HGNotification接口示例</div>
<div class="divc2" id="content20">

    <button id="btn41" class="button" onclick="showAlert()">showAlert</button>显示一个定制的警告或对话框
   <br>
    <button id="btn42" class="button" onclick="playBeep()">playBeep</button>设备将发出蜂鸣声（苹果设备需打开左侧蜂鸣按钮）
    <br>
    <button id="btn43" class="button" onclick="showConfirm()">showConfirm</button>显示一个可定制的确认对话框
    <br>
    <button id="btn44" class="button" onclick="showPrompt()">showPrompt</button>显示一个可定制的Prompt对话框
    <br>
    <button id="btn45" class="button" onclick="vibrate()">vibrate</button>震动
    <br>
</div>

<div class="divc1" id="title21">HGStorage接口示例</div>
<div class="divc2" id="content21">
    <br />
    <!--<button id="btn49" name="btn49" onclick="openDatabase()">openDatabase</button>返回一个新的Database对象-->
    <a href="HTML/second.html" target="_self" title="跳转">跳转HGStorge页面</a>
    <br />
</div>

<div class="divc1" id="title22">HGUserCert接口示例</div>

<div class="divc2" id="content22">

<button id="btn55" class="button" onclick="getUserCertInfo()">getUserCertInfo</button>获取证书相关信息
   <br>
    <button id="btn56" class="button" onclick="getSignData()">getSignData</button>对数据签名
    <br>
    <button id="btn57" class="button" onclick="verifyData()">verifyData</button>验签
    <br>
    <button id="btn58" class="button" onclick="encryptData()">encryptData</button>加密
    <br>
    <button id="btn59" class="button" onclick="decryptData()">decryptData</button>解密
    <br>
</div>
<p>注：该接口仅支持综合办公一类TF卡登陆</p>


<div id = "showToken">


</div>



</body>


